<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system.  The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.).  Octal values should
| always be used to set the mode correctly.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);

/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/

define('FOPEN_READ', 							'rb');
define('FOPEN_READ_WRITE',						'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 		'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 	'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 					'ab');
define('FOPEN_READ_WRITE_CREATE', 				'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 			'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT',		'x+b');

$base_url = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$base_url .= "://".$_SERVER['HTTP_HOST'];
$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);

define('IMG_DIR', $base_url.'images');
define('CSS_DIR', $base_url.'include/css');
define('JS_DIR',  $base_url.'include/js');
define('INCLUDE_DIR', $base_url.'include');
define('VIEW_DIR', $base_url.'system/application/views');
define('WIDGET_DIR', $base_url.'widgets');
define('HOST_DIR', $_SERVER['HTTP_HOST']);
define('BASEURL', $base_url);

define('DATA_ROOT', './data');  // 파일 저장시 경로.
define('ADMIN','admin');        // 어플리케이션 및 뷰에서 어드민 폴더 이름.
/*
|--------------------------------------------------------------------------
| 테이블 및 시간 관련 상수 선언.
|--------------------------------------------------------------------------
| 서버의 시간과 실제 사용하는 시간이 틀린 경우 수정하세요.
| 하루는 86400 초입니다. 1시간은 3600초
| 6시간이 빠른 경우 time() + (3600 * 6);
| 6시간이 느린 경우 time() - (3600 * 6);
*/

$serviertime = time();
define('SERVERTIME',$serviertime);
define('TIME_YMD',date("Y-m-d", $serviertime));
define('TIME_HIS',date("H:i:s", $serviertime));
define('TIME_YMDHIS',date("Y-m-d H:i:s", $serviertime));

define('TABLE_PREFIX','g4_');  // 테이블 명 접두사 
define('WRITE_PREFIX','write_');  // 게시판 테이블 명 접두사

define('G4_GROUP',TABLE_PREFIX.'group');  // 그룹 테이블
define('G4_BOARD',TABLE_PREFIX.'board');  // 게시판 환경설정 테이블

define('USER_TABLE','users');  // 사용자 테이블

/* End of file constants.php */
/* Location: ./system/application/config/constants.php */